bfi_nostereo_comp <- lmer(bfi_targ_pmc ~ bfi_self_pmc*itt_comp_gmc +
(bfi_self_pmc | sub_id), data = clean_data_bfi)
tab_model(bfi_nostereo_comp)
| bfi_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.01 | -0.03 – 0.05 | 0.631 |
| bfi self pmc | 0.01 | -0.02 – 0.03 | 0.730 |
| itt comp gmc | -0.29 | -0.33 – -0.25 | <0.001 |
|
bfi self pmc * itt comp gmc |
-0.13 | -0.16 – -0.11 | <0.001 |
| Random Effects | |||
| σ2 | 0.94 | ||
| τ00 sub_id | 0.15 | ||
| τ11 sub_id.bfi_self_pmc | 0.06 | ||
| ρ01 sub_id | 0.64 | ||
| ICC | 0.21 | ||
| N sub_id | 424 | ||
| Observations | 8056 | ||
| Marginal R2 / Conditional R2 | 0.105 / 0.294 | ||
bfi_nostereo_targ <- lmer(bfi_targ_pmc ~ bfi_self_pmc*target_condition +
(bfi_self_pmc | sub_id), data = clean_data_bfi)
comp_eli_randslopes <- lmer(eli_targ_pmc ~ eli_self_pmc*itt_comp_gmc + # itt does not work as a RE; model does not converge
(0 + eli_self_pmc | sub_id),
data = clean_data_eli)
tab_model(comp_eli_randslopes)
| eli_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.00 | -0.03 – 0.03 | 1.000 |
| eli self pmc | 0.01 | -0.02 – 0.04 | 0.378 |
| itt comp gmc | 0.00 | -0.03 – 0.03 | 1.000 |
|
eli self pmc * itt comp gmc |
-0.09 | -0.11 – -0.06 | <0.001 |
| Random Effects | |||
| σ2 | 1.00 | ||
| τ00 | |||
| τ00 | |||
| τ11 sub_id.eli_self_pmc | 0.04 | ||
| ρ01 | |||
| ρ01 | |||
| ICC | 0.06 | ||
| N sub_id | 424 | ||
| Observations | 4240 | ||
| Marginal R2 / Conditional R2 | 0.013 / 0.071 | ||
cond_eli_randslopes <- lmer(eli_targ_pmc ~ eli_self_pmc*target_condition + # itt does not work as a RE; model does not converge
(0 + eli_self_pmc | sub_id),
data = clean_data_eli)
bfi_stereo_comp <- lmer(bfi_targ_pmc ~ bfi_self_pmc*itt_comp_gmc*bfi_stereo_pmc +
(bfi_self_pmc + bfi_stereo_pmc | sub_id), data = clean_data_bfi)
summary(bfi_stereo_comp)
## Linear mixed model fit by REML ['lmerMod']
## Formula: bfi_targ_pmc ~ bfi_self_pmc * itt_comp_gmc * bfi_stereo_pmc +
## (bfi_self_pmc + bfi_stereo_pmc | sub_id)
## Data: clean_data_bfi
##
## REML criterion at convergence: 21421.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.2701 -0.5006 -0.0365 0.6200 4.2064
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## sub_id (Intercept) 0.12671 0.3560
## bfi_self_pmc 0.03947 0.1987 0.46
## bfi_stereo_pmc 0.06654 0.2580 -0.69 -0.07
## Residual 0.70284 0.8384
## Number of obs: 8056, groups: sub_id, 424
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.020974 0.020143 1.041
## bfi_self_pmc 0.067192 0.012663 5.306
## itt_comp_gmc -0.258769 0.018832 -13.741
## bfi_stereo_pmc 0.224519 0.015642 14.354
## bfi_self_pmc:itt_comp_gmc -0.072592 0.011798 -6.153
## bfi_self_pmc:bfi_stereo_pmc -0.017398 0.006252 -2.783
## itt_comp_gmc:bfi_stereo_pmc 0.190791 0.014562 13.102
## bfi_self_pmc:itt_comp_gmc:bfi_stereo_pmc -0.005255 0.005662 -0.928
##
## Correlation of Fixed Effects:
## (Intr) bf_sl_ itt_c_ bf_st_ bf_slf_pmc:t__ bf_slf_pmc:b__ i__:__
## bfi_slf_pmc 0.293
## itt_cmp_gmc -0.001 0.008
## bfi_str_pmc -0.480 0.052 0.026
## bf_slf_pmc:t__ 0.008 -0.026 0.287 -0.003
## bf_slf_pmc:b__ 0.140 -0.084 -0.009 0.073 0.046
## itt_cmp_:__ 0.026 -0.004 -0.481 -0.060 0.052 -0.001
## bf_s_:__:__ -0.010 0.046 0.142 -0.004 -0.079 -0.180 0.057
tab_model(bfi_stereo_comp)
| bfi_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.02 | -0.02 – 0.06 | 0.298 |
| bfi self pmc | 0.07 | 0.04 – 0.09 | <0.001 |
| itt comp gmc | -0.26 | -0.30 – -0.22 | <0.001 |
| bfi stereo pmc | 0.22 | 0.19 – 0.26 | <0.001 |
|
bfi self pmc * itt comp gmc |
-0.07 | -0.10 – -0.05 | <0.001 |
|
bfi self pmc * bfi stereo pmc |
-0.02 | -0.03 – -0.01 | 0.005 |
|
itt comp gmc * bfi stereo pmc |
0.19 | 0.16 – 0.22 | <0.001 |
|
(bfi self pmc * itt comp gmc) * bfi stereo pmc |
-0.01 | -0.02 – 0.01 | 0.353 |
| Random Effects | |||
| σ2 | 0.70 | ||
| τ00 sub_id | 0.13 | ||
| τ11 sub_id.bfi_self_pmc | 0.04 | ||
| τ11 sub_id.bfi_stereo_pmc | 0.07 | ||
| ρ01 | 0.46 | ||
| -0.69 | |||
| ICC | 0.31 | ||
| N sub_id | 424 | ||
| Observations | 8056 | ||
| Marginal R2 / Conditional R2 | 0.219 / 0.458 | ||
anova(bfi_stereo_comp, bfi_nostereo_comp)
## Data: clean_data_bfi
## Models:
## bfi_nostereo_comp: bfi_targ_pmc ~ bfi_self_pmc * itt_comp_gmc + (bfi_self_pmc | sub_id)
## bfi_stereo_comp: bfi_targ_pmc ~ bfi_self_pmc * itt_comp_gmc * bfi_stereo_pmc + (bfi_self_pmc + bfi_stereo_pmc | sub_id)
## npar AIC BIC logLik deviance Chisq Df
## bfi_nostereo_comp 8 23325 23381 -11654 23309
## bfi_stereo_comp 15 21394 21499 -10682 21364 1944.4 7
## Pr(>Chisq)
## bfi_nostereo_comp
## bfi_stereo_comp < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
threat_levels = list(itt_comp_gmc = c(-1.07, 0.0, 1.07))
simpslopes_bfi_stereo2 <- emtrends(bfi_stereo_comp, ~ itt_comp_gmc,
var ="bfi_self_pmc",
at = c(threat_levels))
simpslopes_bfi_stereo2
## itt_comp_gmc bfi_self_pmc.trend SE df asymp.LCL asymp.UCL
## -1.07 0.14512 0.0181 Inf 0.1096 0.1807
## 0.00 0.06757 0.0127 Inf 0.0427 0.0924
## 1.07 -0.00999 0.0177 Inf -0.0446 0.0246
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
test(simpslopes_bfi_stereo2)
## itt_comp_gmc bfi_self_pmc.trend SE df z.ratio p.value
## -1.07 0.14512 0.0181 Inf 8.002 <.0001
## 0.00 0.06757 0.0127 Inf 5.331 <.0001
## 1.07 -0.00999 0.0177 Inf -0.566 0.5717
##
## Degrees-of-freedom method: asymptotic
pairs(simpslopes_bfi_stereo2)
## contrast estimate SE df z.ratio p.value
## (-1.07) - 0 0.0776 0.0126 Inf 6.138 <.0001
## (-1.07) - 1.07 0.1551 0.0253 Inf 6.138 <.0001
## 0 - 1.07 0.0776 0.0126 Inf 6.138 <.0001
##
## Degrees-of-freedom method: asymptotic
## P value adjustment: tukey method for comparing a family of 3 estimates
bfi_stereo_comp_df <- effect("bfi_self_pmc:itt_comp_gmc",
xlevels = list(itt_comp_gmc = c(-1.07, 0.0, 1.07)),
mod = bfi_stereo_comp)
bfi_stereo_comp_df <- as.data.frame(bfi_stereo_comp_df)
bfi_stereo_comp_df$itt_comp_gmc <- as.factor(bfi_stereo_comp_df$itt_comp_gmc)
ggplot(bfi_stereo_comp_df, aes(bfi_self_pmc, fit, group = itt_comp_gmc)) +
geom_smooth(method = "lm",
size = .7,
se = FALSE,
colour = "black",
aes(linetype = itt_comp_gmc)) +
theme_minimal(base_size = 13) +
theme(legend.key.size = unit(1, "cm")) +
scale_linetype_manual("Target-level threat",
breaks = c("-1.07", "0", "1.07"),
labels = c("Low",
"Average",
"High"),
values = c("solid",
"dashed",
"dotted")) +
labs(x = "BFI responses for self",
y = "BFI responses for target")
# checking normality of conditional residuals
qqnorm(residuals(bfi_stereo_comp), main="Q-Q plot for conditional residuals")
# checking the normality of the random effects (here random intercept):
qqnorm(ranef(bfi_stereo_comp)$sub_id$bfi_self_pmc,
main="Q-Q plot for the self random effect")
qqnorm(ranef(bfi_stereo_comp)$sub_id$bfi_stereo_pmc,
main="Q-Q plot for the stereotyping random effect")
# Checking residuals for intercept
qqnorm(ranef(bfi_stereo_comp)$sub_id$`(Intercept)`,
main="Q-Q plot for the random intercept")
plot_model(bfi_stereo_comp, type='diag')
## [[1]]
##
## [[2]]
## [[2]]$sub_id
##
##
## [[3]]
##
## [[4]]
Also seems to have slight tails, basically when stereotyping is added to the model
bfi_stereo_targ <- lmer(bfi_targ_pmc ~ bfi_self_pmc*target_condition*bfi_stereo_pmc +
(bfi_self_pmc + bfi_stereo_pmc | sub_id), data = clean_data_bfi)
summary(bfi_stereo_targ)
## Linear mixed model fit by REML ['lmerMod']
## Formula: bfi_targ_pmc ~ bfi_self_pmc * target_condition * bfi_stereo_pmc +
## (bfi_self_pmc + bfi_stereo_pmc | sub_id)
## Data: clean_data_bfi
##
## REML criterion at convergence: 21340.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.2464 -0.5115 -0.0147 0.6157 4.1866
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## sub_id (Intercept) 0.09682 0.3112
## bfi_self_pmc 0.03829 0.1957 0.46
## bfi_stereo_pmc 0.05383 0.2320 -0.61 -0.04
## Residual 0.70369 0.8389
## Number of obs: 8056, groups: sub_id, 424
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.3829478 0.0307099 12.470
## bfi_self_pmc 0.1629014 0.0211286 7.710
## target_conditionLOSS -0.8128246 0.0452597 -17.959
## target_conditionWARM -0.3514308 0.0438284 -8.018
## bfi_stereo_pmc -0.0498397 0.0247279 -2.016
## bfi_self_pmc:target_conditionLOSS -0.1968343 0.0310241 -6.345
## bfi_self_pmc:target_conditionWARM -0.1022632 0.0300178 -3.407
## bfi_self_pmc:bfi_stereo_pmc -0.0140133 0.0107222 -1.307
## target_conditionLOSS:bfi_stereo_pmc 0.5804411 0.0361282 16.066
## target_conditionWARM:bfi_stereo_pmc 0.3191316 0.0349720 9.125
## bfi_self_pmc:target_conditionLOSS:bfi_stereo_pmc -0.0112412 0.0153390 -0.733
## bfi_self_pmc:target_conditionWARM:bfi_stereo_pmc 0.0001332 0.0148092 0.009
##
## Correlation of Fixed Effects:
## (Intr) bf_sl_ tr_LOSS tr_WARM bf_st_ bf__:_LOSS bf__:_WARM b__:__
## bfi_slf_pmc 0.273
## trgt_cnLOSS -0.679 -0.185
## trgt_cnWARM -0.701 -0.192 0.475
## bfi_str_pmc -0.402 0.084 0.273 0.282
## bf_s_:_LOSS -0.186 -0.681 0.275 0.130 -0.057
## bf_s_:_WARM -0.192 -0.704 0.131 0.286 -0.059 0.479
## bf_slf_p:__ 0.158 -0.090 -0.107 -0.111 0.074 0.061 0.063
## trg_LOSS:__ 0.275 -0.058 -0.405 -0.193 -0.684 0.080 0.041 -0.050
## trg_WARM:__ 0.284 -0.060 -0.193 -0.390 -0.707 0.041 0.087 -0.052
## b__:_LOSS:_ -0.110 0.063 0.147 0.077 -0.051 -0.088 -0.044 -0.699
## b__:_WARM:_ -0.114 0.065 0.078 0.162 -0.053 -0.044 -0.069 -0.724
## t_LOSS: t_WARM: b__:_LOSS:
## bfi_slf_pmc
## trgt_cnLOSS
## trgt_cnWARM
## bfi_str_pmc
## bf_s_:_LOSS
## bf_s_:_WARM
## bf_slf_p:__
## trg_LOSS:__
## trg_WARM:__ 0.484
## b__:_LOSS:_ 0.062 0.036
## b__:_WARM:_ 0.036 0.089 0.506
tab_model(bfi_stereo_targ)
| bfi_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.38 | 0.32 – 0.44 | <0.001 |
| bfi self pmc | 0.16 | 0.12 – 0.20 | <0.001 |
| target condition [LOSS] | -0.81 | -0.90 – -0.72 | <0.001 |
| target condition [WARM] | -0.35 | -0.44 – -0.27 | <0.001 |
| bfi stereo pmc | -0.05 | -0.10 – -0.00 | 0.044 |
|
bfi self pmc * target condition [LOSS] |
-0.20 | -0.26 – -0.14 | <0.001 |
|
bfi self pmc * target condition [WARM] |
-0.10 | -0.16 – -0.04 | 0.001 |
|
bfi self pmc * bfi stereo pmc |
-0.01 | -0.04 – 0.01 | 0.191 |
|
target condition [LOSS] * bfi stereo pmc |
0.58 | 0.51 – 0.65 | <0.001 |
|
target condition [WARM] * bfi stereo pmc |
0.32 | 0.25 – 0.39 | <0.001 |
|
(bfi self pmc * target condition [LOSS]) * bfi stereo pmc |
-0.01 | -0.04 – 0.02 | 0.464 |
|
(bfi self pmc * target condition [WARM]) * bfi stereo pmc |
0.00 | -0.03 – 0.03 | 0.993 |
| Random Effects | |||
| σ2 | 0.70 | ||
| τ00 sub_id | 0.10 | ||
| τ11 sub_id.bfi_self_pmc | 0.04 | ||
| τ11 sub_id.bfi_stereo_pmc | 0.05 | ||
| ρ01 | 0.46 | ||
| -0.61 | |||
| ICC | 0.27 | ||
| N sub_id | 424 | ||
| Observations | 8056 | ||
| Marginal R2 / Conditional R2 | 0.248 / 0.448 | ||
anova(bfi_stereo_targ, bfi_nostereo_targ)
## Data: clean_data_bfi
## Models:
## bfi_nostereo_targ: bfi_targ_pmc ~ bfi_self_pmc * target_condition + (bfi_self_pmc | sub_id)
## bfi_stereo_targ: bfi_targ_pmc ~ bfi_self_pmc * target_condition * bfi_stereo_pmc + (bfi_self_pmc + bfi_stereo_pmc | sub_id)
## npar AIC BIC logLik deviance Chisq Df
## bfi_nostereo_targ 10 23285 23355 -11632 23265
## bfi_stereo_targ 19 21306 21439 -10634 21268 1997.1 9
## Pr(>Chisq)
## bfi_nostereo_targ
## bfi_stereo_targ < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
targ_levels <-list(target_condition = c("CONTROL", "LOSS", "WARM"))
simpslopes_bfi_stereo_targ <- emtrends(bfi_stereo_targ, ~ target_condition,
var ="bfi_self_pmc",
at = targ_levels)
simpslopes_bfi_stereo_targ
## target_condition bfi_self_pmc.trend SE df asymp.LCL asymp.UCL
## CONTROL 0.1632 0.0212 Inf 0.1217 0.2047
## LOSS -0.0334 0.0227 Inf -0.0780 0.0112
## WARM 0.0609 0.0213 Inf 0.0191 0.1028
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
test(simpslopes_bfi_stereo_targ)
## target_condition bfi_self_pmc.trend SE df z.ratio p.value
## CONTROL 0.1632 0.0212 Inf 7.716 <.0001
## LOSS -0.0334 0.0227 Inf -1.468 0.1420
## WARM 0.0609 0.0213 Inf 2.856 0.0043
##
## Degrees-of-freedom method: asymptotic
pairs(simpslopes_bfi_stereo_targ)
## contrast estimate SE df z.ratio p.value
## CONTROL - LOSS 0.1966 0.0311 Inf 6.330 <.0001
## CONTROL - WARM 0.1023 0.0300 Inf 3.404 0.0019
## LOSS - WARM -0.0943 0.0312 Inf -3.025 0.0070
##
## Degrees-of-freedom method: asymptotic
## P value adjustment: tukey method for comparing a family of 3 estimates
bfi_stereo_targ_df <- effect("bfi_self_pmc:target_condition",
xlevels = list(target_condition = c("CONTROL",
"WARM",
"LOSS")),
mod = bfi_stereo_targ)
bfi_stereo_targ_df <- as.data.frame(bfi_stereo_targ_df)
bfi_stereo_targ_df$target_condition <- as.factor(bfi_stereo_targ_df$target_condition)
bfi_stereo_targ_df %<>%
mutate(target_condition = forcats::fct_relevel(target_condition, c("CONTROL", "WARM", "LOSS")))
ggplot(bfi_stereo_targ_df, aes(bfi_self_pmc, fit, group = target_condition)) +
geom_smooth(method = "lm",
size = .7,
se = FALSE,
colour = "black",
aes(linetype = target_condition)) +
theme_minimal(base_size = 13) +
theme(legend.key.size = unit(1, "cm")) +
scale_linetype_manual("Target variable",
breaks = c("CONTROL", "WARM", "LOSS"),
labels = c("Least threatening",
"Medium threatening",
"Most threatening"),
values = c("solid",
"dashed",
"dotted"))+
labs(x = "BFI responses for self",
y = "BFI responses for target")
# checking normality of conditional residuals
qqnorm(residuals(bfi_stereo_targ), main="Q-Q plot for conditional residuals")
# checking the normality of the random effects
qqnorm(ranef(bfi_stereo_targ)$sub_id$bfi_self_pmc,
main="Q-Q plot for the self random effect")
qqnorm(ranef(bfi_stereo_targ)$sub_id$bfi_stereo_pmc,
main="Q-Q plot for the stereotyping random effect")
# Checking residuals for intercept
qqnorm(ranef(bfi_stereo_targ)$sub_id$`(Intercept)`,
main="Q-Q plot for the random intercept")
plot_model(bfi_stereo_targ, type='diag')
## [[1]]
##
## [[2]]
## [[2]]$sub_id
##
##
## [[3]]
##
## [[4]]
Definitely a tail, but only a few points, so most likely robust; stereo is the worst, may need to transform it
comp_eli_stereo <- lmer(eli_targ_pmc ~ eli_self_pmc*itt_comp_gmc*eli_stereo_pmc + # itt does not work as a RE; model does not converge
(0 + eli_self_pmc + eli_stereo_pmc | sub_id),
data = clean_data_eli) # Same as above, works with clean_data but not the smaller df specific to this analysis
summary(comp_eli_stereo)
## Linear mixed model fit by REML ['lmerMod']
## Formula: eli_targ_pmc ~ eli_self_pmc * itt_comp_gmc * eli_stereo_pmc +
## (0 + eli_self_pmc + eli_stereo_pmc | sub_id)
## Data: clean_data_eli
##
## REML criterion at convergence: 11416.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6808 -0.5355 0.0171 0.5988 3.4913
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## sub_id eli_self_pmc 0.02599 0.1612
## eli_stereo_pmc 0.07400 0.2720 -0.01
## Residual 0.75865 0.8710
## Number of obs: 4240, groups: sub_id, 424
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.0011854 0.0134003 0.088
## eli_self_pmc 0.0275174 0.0136422 2.017
## itt_comp_gmc 0.0004259 0.0125165 0.034
## eli_stereo_pmc 0.2737683 0.0187626 14.591
## eli_self_pmc:itt_comp_gmc -0.0615540 0.0127172 -4.840
## eli_self_pmc:eli_stereo_pmc 0.0047924 0.0089489 0.536
## itt_comp_gmc:eli_stereo_pmc 0.1379914 0.0174409 7.912
## eli_self_pmc:itt_comp_gmc:eli_stereo_pmc 0.0120902 0.0081329 1.487
##
## Correlation of Fixed Effects:
## (Intr) el_sl_ itt_c_ el_st_ el_slf_pmc:t__ el_slf_pmc:l__ i__:__
## eli_slf_pmc 0.000
## itt_cmp_gmc 0.000 0.003
## eli_str_pmc -0.002 -0.012 0.000
## el_slf_pmc:t__ 0.003 -0.020 0.000 0.031
## el_slf_pmc:l__ -0.006 0.050 0.061 -0.004 -0.006
## itt_cmp_:__ 0.000 0.030 -0.002 -0.038 -0.012 -0.026
## el_s_:__:__ 0.060 -0.007 -0.005 -0.025 0.045 -0.097 -0.001
tab_model(comp_eli_stereo,
digits = 3)
| eli_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.001 | -0.025 – 0.027 | 0.930 |
| eli self pmc | 0.028 | 0.001 – 0.054 | 0.044 |
| itt comp gmc | 0.000 | -0.024 – 0.025 | 0.973 |
| eli stereo pmc | 0.274 | 0.237 – 0.311 | <0.001 |
|
eli self pmc * itt comp gmc |
-0.062 | -0.086 – -0.037 | <0.001 |
|
eli self pmc * eli stereo pmc |
0.005 | -0.013 – 0.022 | 0.592 |
|
itt comp gmc * eli stereo pmc |
0.138 | 0.104 – 0.172 | <0.001 |
|
(eli self pmc * itt comp gmc) * eli stereo pmc |
0.012 | -0.004 – 0.028 | 0.137 |
| Random Effects | |||
| σ2 | 0.76 | ||
| τ00 | |||
| τ00 | |||
| τ11 sub_id.eli_self_pmc | 0.03 | ||
| τ11 sub_id.eli_stereo_pmc | 0.07 | ||
| ρ01 sub_id | -0.01 | ||
| ICC | 0.16 | ||
| N sub_id | 424 | ||
| Observations | 4240 | ||
| Marginal R2 / Conditional R2 | 0.149 / 0.287 | ||
anova(comp_eli_randslopes, comp_eli_stereo)
## Data: clean_data_eli
## Models:
## comp_eli_randslopes: eli_targ_pmc ~ eli_self_pmc * itt_comp_gmc + (0 + eli_self_pmc | sub_id)
## comp_eli_stereo: eli_targ_pmc ~ eli_self_pmc * itt_comp_gmc * eli_stereo_pmc + (0 + eli_self_pmc + eli_stereo_pmc | sub_id)
## npar AIC BIC logLik deviance Chisq Df
## comp_eli_randslopes 6 12219 12257 -6103.3 12207
## comp_eli_stereo 12 11386 11462 -5680.9 11362 844.88 6
## Pr(>Chisq)
## comp_eli_randslopes
## comp_eli_stereo < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp_stereo_simpslopes_eli <- emtrends(comp_eli_stereo, ~ itt_comp_gmc,
var ="eli_self_pmc",
at = threat_levels)
comp_stereo_simpslopes_eli
## itt_comp_gmc eli_self_pmc.trend SE df asymp.LCL asymp.UCL
## -1.07 0.0934 0.0195 Inf 0.055240 0.131520
## 0.00 0.0275 0.0136 Inf 0.000779 0.054256
## 1.07 -0.0383 0.0191 Inf -0.075732 -0.000958
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
test(comp_stereo_simpslopes_eli)
## itt_comp_gmc eli_self_pmc.trend SE df z.ratio p.value
## -1.07 0.0934 0.0195 Inf 4.799 <.0001
## 0.00 0.0275 0.0136 Inf 2.017 0.0437
## 1.07 -0.0383 0.0191 Inf -2.010 0.0444
##
## Degrees-of-freedom method: asymptotic
pairs(comp_stereo_simpslopes_eli)
## contrast estimate SE df z.ratio p.value
## (-1.07) - 0 0.0659 0.0136 Inf 4.840 <.0001
## (-1.07) - 1.07 0.1317 0.0272 Inf 4.840 <.0001
## 0 - 1.07 0.0659 0.0136 Inf 4.840 <.0001
##
## Degrees-of-freedom method: asymptotic
## P value adjustment: tukey method for comparing a family of 3 estimates
comp_stereo_eli_maineffect <- effect("eli_self_pmc:itt_comp_gmc",
xlevels = list(itt_comp_gmc = c(-1.07, 0, 1.07)),
mod = comp_eli_stereo)
comp_stereo_eli_maineffect <- as.data.frame(comp_stereo_eli_maineffect)
comp_stereo_eli_maineffect$itt_comp_gmc <- as.factor(comp_stereo_eli_maineffect$itt_comp_gmc)
ggplot(comp_stereo_eli_maineffect, aes(eli_self_pmc, fit, group = itt_comp_gmc)) +
geom_smooth(method = "lm",
size = .7,
se = FALSE,
colour = "black",
aes(linetype = itt_comp_gmc)) +
theme_minimal(base_size = 13) +
theme(legend.key.size = unit(1, "cm")) +
scale_linetype_manual("Target-level threat",
breaks = c(-1.07, 0, 1.07),
labels = c("Low",
"Average",
"High"),
values = c("solid",
"dashed",
"dotted")) +
labs(x = "ELI responses for self",
y = "ELI responses for target")
# checking normality of conditional residuals
qqnorm(residuals(comp_eli_stereo), main="Q-Q plot for conditional residuals")
# checking the normality of the random effects:
qqnorm(ranef(comp_eli_stereo)$sub_id$eli_self_pmc,
main="Q-Q plot for the self random effect")
# looking at random effect for stereo:
qqnorm(ranef(comp_eli_stereo)$sub_id$eli_stereo_pmc,
main="Q-Q plot for the self random effect")
plot_model(comp_eli_stereo, type='diag')
## [[1]]
##
## [[2]]
## [[2]]$sub_id
##
##
## [[3]]
##
## [[4]]
Heavy tail and outliers?
cond_eli_stereo <- lmer(eli_targ_pmc ~ eli_self_pmc*eli_stereo_pmc*target_condition + # itt does not work as a RE; model does not converge
(0 + eli_self_pmc + eli_stereo_pmc | sub_id),
data = clean_data_eli) # Same as above, works with clean_data but not the smaller df specific to this analysis
summary(cond_eli_stereo)
## Linear mixed model fit by REML ['lmerMod']
## Formula: eli_targ_pmc ~ eli_self_pmc * eli_stereo_pmc * target_condition +
## (0 + eli_self_pmc + eli_stereo_pmc | sub_id)
## Data: clean_data_eli
##
## REML criterion at convergence: 11373.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6819 -0.5429 0.0178 0.6014 3.2908
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## sub_id eli_self_pmc 0.02347 0.1532
## eli_stereo_pmc 0.06215 0.2493 0.12
## Residual 0.75803 0.8707
## Number of obs: 4240, groups: sub_id, 424
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.0002328 0.0224160 0.010
## eli_self_pmc 0.1338943 0.0224289 5.970
## eli_stereo_pmc 0.0810428 0.0300435 2.698
## target_conditionLOSS 0.0007506 0.0330904 0.023
## target_conditionWARM -0.0002031 0.0320206 -0.006
## eli_self_pmc:eli_stereo_pmc -0.0051313 0.0151045 -0.340
## eli_self_pmc:target_conditionLOSS -0.2153508 0.0329531 -6.535
## eli_self_pmc:target_conditionWARM -0.1332556 0.0320985 -4.151
## eli_stereo_pmc:target_conditionLOSS 0.4645453 0.0444925 10.441
## eli_stereo_pmc:target_conditionWARM 0.1863188 0.0424698 4.387
## eli_self_pmc:eli_stereo_pmc:target_conditionLOSS 0.0344047 0.0218068 1.578
## eli_self_pmc:eli_stereo_pmc:target_conditionWARM 0.0070513 0.0214247 0.329
##
## Correlation of Fixed Effects:
## (Intr) el_sl_ el_st_ t_LOSS t_WARM el__:__ el_sl_:_LOSS
## eli_slf_pmc -0.002
## eli_str_pmc -0.001 0.030
## trgt_cnLOSS -0.677 0.001 0.000
## trgt_cnWARM -0.700 0.001 0.000 0.474
## el_slf_p:__ -0.031 0.053 0.021 0.021 0.021
## el_sl_:_LOSS 0.001 -0.681 -0.020 0.000 -0.001 -0.036
## el_sl_:_WARM 0.001 -0.699 -0.021 -0.001 0.000 -0.037 0.476
## el_st_:_LOSS 0.000 -0.020 -0.675 0.000 0.000 -0.014 0.043
## el_st_:_WARM 0.000 -0.021 -0.707 0.000 -0.001 -0.015 0.014
## e__:__:_LOS 0.021 -0.037 -0.014 -0.003 -0.015 -0.693 0.038
## e__:__:_WAR 0.022 -0.037 -0.015 -0.015 -0.010 -0.705 0.025
## el_sl_:_WARM el_st_:_LOSS el_st_:_WARM e__:__:_L
## eli_slf_pmc
## eli_str_pmc
## trgt_cnLOSS
## trgt_cnWARM
## el_slf_p:__
## el_sl_:_LOSS
## el_sl_:_WARM
## el_st_:_LOSS 0.014
## el_st_:_WARM 0.037 0.478
## e__:__:_LOS 0.026 0.014 0.010
## e__:__:_WAR 0.061 0.010 -0.014 0.488
tab_model(cond_eli_stereo,
digits = 3)
| eli_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.000 | -0.044 – 0.044 | 0.992 |
| eli self pmc | 0.134 | 0.090 – 0.178 | <0.001 |
| eli stereo pmc | 0.081 | 0.022 – 0.140 | 0.007 |
| target condition [LOSS] | 0.001 | -0.064 – 0.066 | 0.982 |
| target condition [WARM] | -0.000 | -0.063 – 0.063 | 0.995 |
|
eli self pmc * eli stereo pmc |
-0.005 | -0.035 – 0.024 | 0.734 |
|
eli self pmc * target condition [LOSS] |
-0.215 | -0.280 – -0.151 | <0.001 |
|
eli self pmc * target condition [WARM] |
-0.133 | -0.196 – -0.070 | <0.001 |
|
eli stereo pmc * target condition [LOSS] |
0.465 | 0.377 – 0.552 | <0.001 |
|
eli stereo pmc * target condition [WARM] |
0.186 | 0.103 – 0.270 | <0.001 |
|
(eli self pmc * eli stereo pmc) * target condition [LOSS] |
0.034 | -0.008 – 0.077 | 0.115 |
|
(eli self pmc * eli stereo pmc) * target condition [WARM] |
0.007 | -0.035 – 0.049 | 0.742 |
| Random Effects | |||
| σ2 | 0.76 | ||
| τ00 | |||
| τ00 | |||
| τ11 sub_id.eli_self_pmc | 0.02 | ||
| τ11 sub_id.eli_stereo_pmc | 0.06 | ||
| ρ01 sub_id | 0.12 | ||
| ICC | 0.14 | ||
| N sub_id | 424 | ||
| Observations | 4240 | ||
| Marginal R2 / Conditional R2 | 0.167 / 0.286 | ||
anova(cond_eli_randslopes, cond_eli_stereo)
## Data: clean_data_eli
## Models:
## cond_eli_randslopes: eli_targ_pmc ~ eli_self_pmc * target_condition + (0 + eli_self_pmc | sub_id)
## cond_eli_stereo: eli_targ_pmc ~ eli_self_pmc * eli_stereo_pmc * target_condition + (0 + eli_self_pmc + eli_stereo_pmc | sub_id)
## npar AIC BIC logLik deviance Chisq Df
## cond_eli_randslopes 8 12216 12267 -6100.1 12200
## cond_eli_stereo 16 11337 11438 -5652.3 11305 895.55 8
## Pr(>Chisq)
## cond_eli_randslopes
## cond_eli_stereo < 0.00000000000000022 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
simpslopes_eli_stereo_cond <- emtrends(cond_eli_stereo, ~ target_condition,
var ="eli_self_pmc",
at = targ_levels)
simpslopes_eli_stereo_cond
## target_condition eli_self_pmc.trend SE df asymp.LCL asymp.UCL
## CONTROL 0.133894 0.0224 Inf 0.0899 0.1779
## LOSS -0.081456 0.0241 Inf -0.1288 -0.0341
## WARM 0.000639 0.0230 Inf -0.0444 0.0456
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
pairs(simpslopes_eli_stereo_cond)
## contrast estimate SE df z.ratio p.value
## CONTROL - LOSS 0.2154 0.0330 Inf 6.535 <.0001
## CONTROL - WARM 0.1333 0.0321 Inf 4.151 0.0001
## LOSS - WARM -0.0821 0.0333 Inf -2.464 0.0366
##
## Degrees-of-freedom method: asymptotic
## P value adjustment: tukey method for comparing a family of 3 estimates
# interactions::interact_plot(compcond_eli_stereo, pred = eli_self_pmc, modx = itt_comp_gmc, mod2 = target_condition, interval = TRUE)
eli_stereo_cond <- effect("eli_self_pmc:target_condition",
xlevels = list(target_condition = c("CONTROL",
"WARM",
"LOSS")),
mod = cond_eli_stereo)
eli_stereo_cond <- as.data.frame(eli_stereo_cond)
eli_stereo_cond$target_condition <- as.factor(eli_stereo_cond$target_condition)
eli_stereo_cond %<>%
mutate(target_condition = forcats::fct_relevel(target_condition, c("CONTROL", "WARM", "LOSS")))
target_labels <- c("CONTROL" = "Control target",
"WARM" = "Warm target",
"LOSS" = "Loss target")
ggplot(eli_stereo_cond, aes(eli_self_pmc, fit, group = target_condition)) +
geom_smooth(method = "lm",
size = .7,
se = FALSE,
colour = "black",
aes(linetype = target_condition)) +
theme_minimal(base_size = 13) +
theme(legend.key.size = unit(1, "cm")) +
scale_linetype_manual("Target Variable",
breaks = c("CONTROL", "WARM", "LOSS"),
labels = c("Least threatening",
"Medium threatening",
"High threatening"),
values = c("solid",
"dashed",
"dotted")) +
labs( x = "ELI responses for self",
y = "ELI responses for target")
# checking normality of conditional residuals
qqnorm(residuals(cond_eli_stereo), main="Q-Q plot for conditional residuals")
# checking the normality of the random effects:
qqnorm(ranef(cond_eli_stereo)$sub_id$eli_self_pmc,
main="Q-Q plot for the self random effect")
# looking at random effect for stereo:
qqnorm(ranef(cond_eli_stereo)$sub_id$eli_stereo_pmc,
main="Q-Q plot for the self random effect")
plot_model(cond_eli_stereo, type='diag')
## [[1]]
##
## [[2]]
## [[2]]$sub_id
##
##
## [[3]]
##
## [[4]]
clean_data_eli %<>%
mutate(analog_condition = forcats::fct_relevel(analog_condition,
c("control",
"analog")))
contrasts(clean_data_eli$analog_condition)
## analog
## control 0
## analog 1
analogcompresid_eli_randslopes <- lmer(eli_targ_pmc ~ eli_self_pmc*analog_condition*itt_comp_gmc*eli_stereo_pmc +
(0 + eli_self_pmc | sub_id), data = clean_data_eli)
summary(analogcompresid_eli_randslopes)
## Linear mixed model fit by REML ['lmerMod']
## Formula: eli_targ_pmc ~ eli_self_pmc * analog_condition * itt_comp_gmc *
## eli_stereo_pmc + (0 + eli_self_pmc | sub_id)
## Data: clean_data_eli
##
## REML criterion at convergence: 11653.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6001 -0.5731 0.0047 0.6361 3.8581
##
## Random effects:
## Groups Name Variance Std.Dev.
## sub_id eli_self_pmc 0.02643 0.1626
## Residual 0.86072 0.9277
## Number of obs: 4240, groups: sub_id, 424
##
## Fixed effects:
## Estimate
## (Intercept) 0.00009902
## eli_self_pmc 0.03211472
## analog_conditionanalog 0.00231098
## itt_comp_gmc 0.00035071
## eli_stereo_pmc 0.26090225
## eli_self_pmc:analog_conditionanalog -0.01963963
## eli_self_pmc:itt_comp_gmc -0.09630714
## analog_conditionanalog:itt_comp_gmc -0.00123674
## eli_self_pmc:eli_stereo_pmc 0.00455667
## analog_conditionanalog:eli_stereo_pmc 0.03014107
## itt_comp_gmc:eli_stereo_pmc 0.12253136
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc 0.05093296
## eli_self_pmc:analog_conditionanalog:eli_stereo_pmc -0.00191679
## eli_self_pmc:itt_comp_gmc:eli_stereo_pmc 0.00065409
## analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 0.04957910
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 0.02132646
## Std. Error
## (Intercept) 0.01984329
## eli_self_pmc 0.01918349
## analog_conditionanalog 0.02863225
## itt_comp_gmc 0.01828336
## eli_stereo_pmc 0.01739249
## eli_self_pmc:analog_conditionanalog 0.02781068
## eli_self_pmc:itt_comp_gmc 0.01773073
## analog_conditionanalog:itt_comp_gmc 0.02680051
## eli_self_pmc:eli_stereo_pmc 0.01271956
## analog_conditionanalog:eli_stereo_pmc 0.02515867
## itt_comp_gmc:eli_stereo_pmc 0.01602528
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc 0.02591899
## eli_self_pmc:analog_conditionanalog:eli_stereo_pmc 0.01853469
## eli_self_pmc:itt_comp_gmc:eli_stereo_pmc 0.01159212
## analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 0.02311958
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 0.01685318
## t value
## (Intercept) 0.005
## eli_self_pmc 1.674
## analog_conditionanalog 0.081
## itt_comp_gmc 0.019
## eli_stereo_pmc 15.001
## eli_self_pmc:analog_conditionanalog -0.706
## eli_self_pmc:itt_comp_gmc -5.432
## analog_conditionanalog:itt_comp_gmc -0.046
## eli_self_pmc:eli_stereo_pmc 0.358
## analog_conditionanalog:eli_stereo_pmc 1.198
## itt_comp_gmc:eli_stereo_pmc 7.646
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc 1.965
## eli_self_pmc:analog_conditionanalog:eli_stereo_pmc -0.103
## eli_self_pmc:itt_comp_gmc:eli_stereo_pmc 0.056
## analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 2.144
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 1.265
tab_model(analogcompresid_eli_randslopes)
| eli_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.00 | -0.04 – 0.04 | 0.996 |
| eli self pmc | 0.03 | -0.01 – 0.07 | 0.094 |
| analog condition [analog] | 0.00 | -0.05 – 0.06 | 0.936 |
| itt comp gmc | 0.00 | -0.04 – 0.04 | 0.985 |
| eli stereo pmc | 0.26 | 0.23 – 0.30 | <0.001 |
|
eli self pmc * analog condition [analog] |
-0.02 | -0.07 – 0.03 | 0.480 |
|
eli self pmc * itt comp gmc |
-0.10 | -0.13 – -0.06 | <0.001 |
|
analog condition [analog] * itt comp gmc |
-0.00 | -0.05 – 0.05 | 0.963 |
|
eli self pmc * eli stereo pmc |
0.00 | -0.02 – 0.03 | 0.720 |
|
analog condition [analog] * eli stereo pmc |
0.03 | -0.02 – 0.08 | 0.231 |
|
itt comp gmc * eli stereo pmc |
0.12 | 0.09 – 0.15 | <0.001 |
|
(eli self pmc * analog condition [analog]) * itt comp gmc |
0.05 | 0.00 – 0.10 | 0.049 |
|
(eli self pmc * analog condition [analog]) * eli stereo pmc |
-0.00 | -0.04 – 0.03 | 0.918 |
|
(eli self pmc * itt comp gmc) * eli stereo pmc |
0.00 | -0.02 – 0.02 | 0.955 |
|
(analog condition [analog] * itt comp gmc) * eli stereo pmc |
0.05 | 0.00 – 0.09 | 0.032 |
|
(eli self pmc * analog condition [analog] * itt comp gmc) * eli stereo pmc |
0.02 | -0.01 – 0.05 | 0.206 |
| Random Effects | |||
| σ2 | 0.86 | ||
| τ00 | |||
| τ00 | |||
| τ11 sub_id.eli_self_pmc | 0.03 | ||
| ρ01 | |||
| ρ01 | |||
| ICC | 0.05 | ||
| N sub_id | 424 | ||
| Observations | 4240 | ||
| Marginal R2 / Conditional R2 | 0.155 / 0.196 | ||
confint(analogcompresid_eli_randslopes)
## 2.5 %
## .sig01 0.1263649944
## .sigma 0.9060721614
## (Intercept) -0.0387513094
## eli_self_pmc -0.0053464440
## analog_conditionanalog -0.0537271544
## itt_comp_gmc -0.0354454282
## eli_stereo_pmc 0.2269352809
## eli_self_pmc:analog_conditionanalog -0.0739477147
## eli_self_pmc:itt_comp_gmc -0.1309366469
## analog_conditionanalog:itt_comp_gmc -0.0536979114
## eli_self_pmc:eli_stereo_pmc -0.0203538912
## analog_conditionanalog:eli_stereo_pmc -0.0192137152
## itt_comp_gmc:eli_stereo_pmc 0.0912147413
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc 0.0002936823
## eli_self_pmc:analog_conditionanalog:eli_stereo_pmc -0.0381511942
## eli_self_pmc:itt_comp_gmc:eli_stereo_pmc -0.0221010670
## analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 0.0042536078
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc -0.0115851940
## 97.5 %
## .sig01 0.19313909
## .sigma 0.94748251
## (Intercept) 0.03893885
## eli_self_pmc 0.06957707
## analog_conditionanalog 0.05837372
## itt_comp_gmc 0.03613729
## eli_stereo_pmc 0.29507423
## eli_self_pmc:analog_conditionanalog 0.03466920
## eli_self_pmc:itt_comp_gmc -0.06167392
## analog_conditionanalog:itt_comp_gmc 0.05123076
## eli_self_pmc:eli_stereo_pmc 0.02942587
## analog_conditionanalog:eli_stereo_pmc 0.07929235
## itt_comp_gmc:eli_stereo_pmc 0.15393568
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc 0.10156417
## eli_self_pmc:analog_conditionanalog:eli_stereo_pmc 0.03439114
## eli_self_pmc:itt_comp_gmc:eli_stereo_pmc 0.02329684
## analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 0.09475630
## eli_self_pmc:analog_conditionanalog:itt_comp_gmc:eli_stereo_pmc 0.05447161
threat_levels = list(itt_comp_gmc = c(-1.07, 0.0, 1.07))
analog_levels = list(analog_condition = c("analog", "control"))
simslopes_analog_resid <- emtrends(analogcompresid_eli_randslopes, ~ itt_comp_gmc*analog_condition,
var ="eli_self_pmc",
at = c(threat_levels, analog_levels))
simslopes_analog_resid
## itt_comp_gmc analog_condition eli_self_pmc.trend SE df asymp.LCL
## -1.07 analog 0.0610 0.0279 Inf 0.00630
## 0.00 analog 0.0125 0.0201 Inf -0.02699
## 1.07 analog -0.0361 0.0291 Inf -0.09320
## -1.07 control 0.1352 0.0280 Inf 0.08028
## 0.00 control 0.0321 0.0192 Inf -0.00548
## 1.07 control -0.0709 0.0259 Inf -0.12174
## asymp.UCL
## 0.1158
## 0.0519
## 0.0211
## 0.1900
## 0.0697
## -0.0201
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
test(simslopes_analog_resid)
## itt_comp_gmc analog_condition eli_self_pmc.trend SE df z.ratio p.value
## -1.07 analog 0.0610 0.0279 Inf 2.186 0.0288
## 0.00 analog 0.0125 0.0201 Inf 0.620 0.5355
## 1.07 analog -0.0361 0.0291 Inf -1.238 0.2158
## -1.07 control 0.1352 0.0280 Inf 4.827 <.0001
## 0.00 control 0.0321 0.0192 Inf 1.674 0.0941
## 1.07 control -0.0709 0.0259 Inf -2.737 0.0062
##
## Degrees-of-freedom method: asymptotic
pairs(simslopes_analog_resid)
## contrast estimate SE df z.ratio p.value
## (-1.07 analog) - 0 analog 0.0486 0.0202 Inf 2.400 0.1561
## (-1.07 analog) - 1.07 analog 0.0971 0.0405 Inf 2.400 0.1561
## (-1.07 analog) - (-1.07 control) -0.0741 0.0395 Inf -1.875 0.4177
## (-1.07 analog) - 0 control 0.0289 0.0339 Inf 0.853 0.9573
## (-1.07 analog) - 1.07 control 0.1320 0.0381 Inf 3.464 0.0071
## 0 analog - 1.07 analog 0.0486 0.0202 Inf 2.400 0.1561
## 0 analog - (-1.07 control) -0.1227 0.0345 Inf -3.557 0.0050
## 0 analog - 0 control -0.0196 0.0278 Inf -0.706 0.9813
## 0 analog - 1.07 control 0.0834 0.0328 Inf 2.541 0.1123
## 1.07 analog - (-1.07 control) -0.1712 0.0404 Inf -4.237 0.0003
## 1.07 analog - 0 control -0.0682 0.0349 Inf -1.954 0.3691
## 1.07 analog - 1.07 control 0.0349 0.0390 Inf 0.894 0.9482
## (-1.07 control) - 0 control 0.1030 0.0190 Inf 5.432 <.0001
## (-1.07 control) - 1.07 control 0.2061 0.0379 Inf 5.432 <.0001
## 0 control - 1.07 control 0.1030 0.0190 Inf 5.432 <.0001
##
## Degrees-of-freedom method: asymptotic
## P value adjustment: tukey method for comparing a family of 6 estimates
analog_resid_df <- effect("eli_self_pmc:analog_condition:itt_comp_gmc",
xlevels = list(itt_comp_gmc = c(-1.07, 0.0, 1.07),
analog_condiion = "analog", "control"),
mod = analogcompresid_eli_randslopes)
analog_resid_df <- as.data.frame(analog_resid_df)
analog_resid_df$itt_comp_gmc <- as.factor(analog_resid_df$itt_comp_gmc)
analog_resid_df$analog_condition <- as.factor(analog_resid_df$analog_condition)
analog_resid_df %<>%
mutate(analog_condition = dplyr::recode(analog_condition,
`analog` = "Analogous instruction \ncondition",
`control` = "Control condition"))
ggplot(analog_resid_df, aes(eli_self_pmc, fit, group = itt_comp_gmc)) +
geom_smooth(method = "lm",
size = .7,
se = FALSE,
colour = "black",
aes(linetype = itt_comp_gmc)) +
theme_minimal(base_size = 13) +
theme(legend.key.size = unit(1, "cm")) +
facet_wrap(vars(analog_condition)) +
scale_linetype_manual("Target-level threat",
breaks = c("-1.07", "0", "1.07"),
labels = c("Low",
"Average",
"High"),
values = c("solid",
"dashed",
"dotted")) +
labs(x = "BFI responses for self",
y = "BFI responses for target")
data_bfi_prolific <- clean_data_bfi %>%
filter(data_site != "uo") %>%
select(sub_id, bfi_number, bfi_targ_pmc, bfi_self_pmc, itt_comp_gmc,
target_condition, bfi_targ, bfi_self, bfi_stereo, bfi_stereo_pmc) %>%
unique() %>%
na.omit()
bfi_nostereo_comp_pro <- lmer(bfi_targ_pmc ~ bfi_self_pmc*itt_comp_gmc +
(bfi_self_pmc | sub_id), data = data_bfi_prolific)
summary(bfi_nostereo_comp_pro)
## Linear mixed model fit by REML ['lmerMod']
## Formula: bfi_targ_pmc ~ bfi_self_pmc * itt_comp_gmc + (bfi_self_pmc |
## sub_id)
## Data: data_bfi_prolific
##
## REML criterion at convergence: 22328.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.7520 -0.6118 -0.0211 0.6556 3.5462
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## sub_id (Intercept) 0.15466 0.3933
## bfi_self_pmc 0.05776 0.2403 0.65
## Residual 0.94523 0.9722
## Number of obs: 7695, groups: sub_id, 405
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.001278 0.022604 0.057
## bfi_self_pmc 0.005070 0.014922 0.340
## itt_comp_gmc -0.290318 0.021185 -13.704
## bfi_self_pmc:itt_comp_gmc -0.137288 0.013909 -9.870
##
## Correlation of Fixed Effects:
## (Intr) bf_sl_ itt_c_
## bfi_slf_pmc 0.452
## itt_cmp_gmc -0.015 -0.005
## bf_slf_p:__ -0.005 -0.029 0.443
tab_model(bfi_nostereo_comp_pro)
| bfi_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.00 | -0.04 – 0.05 | 0.955 |
| bfi self pmc | 0.01 | -0.02 – 0.03 | 0.734 |
| itt comp gmc | -0.29 | -0.33 – -0.25 | <0.001 |
|
bfi self pmc * itt comp gmc |
-0.14 | -0.16 – -0.11 | <0.001 |
| Random Effects | |||
| σ2 | 0.95 | ||
| τ00 sub_id | 0.15 | ||
| τ11 sub_id.bfi_self_pmc | 0.06 | ||
| ρ01 sub_id | 0.65 | ||
| ICC | 0.21 | ||
| N sub_id | 405 | ||
| Observations | 7695 | ||
| Marginal R2 / Conditional R2 | 0.104 / 0.296 | ||
Did not change
bfi_nostereo_comp_pro <- emtrends(bfi_nostereo_comp_pro , ~ itt_comp_gmc,
var ="bfi_self_pmc",
at = c(threat_levels))
bfi_nostereo_comp_pro
## itt_comp_gmc bfi_self_pmc.trend SE df asymp.LCL asymp.UCL
## -1.07 0.15197 0.0214 Inf 0.1101 0.1939
## 0.00 0.00507 0.0149 Inf -0.0242 0.0343
## 1.07 -0.14183 0.0208 Inf -0.1825 -0.1011
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
Did not change
bfi_nostereo_targ_pro <- lmer(bfi_targ_pmc ~ bfi_self_pmc*target_condition +
(bfi_self_pmc | sub_id), data = data_bfi_prolific)
summary(bfi_nostereo_targ_pro)
## Linear mixed model fit by REML ['lmerMod']
## Formula: bfi_targ_pmc ~ bfi_self_pmc * target_condition + (bfi_self_pmc |
## sub_id)
## Data: data_bfi_prolific
##
## REML criterion at convergence: 22291.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.7255 -0.6079 -0.0084 0.6544 3.5841
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## sub_id (Intercept) 0.13379 0.3658
## bfi_self_pmc 0.05639 0.2375 0.65
## Residual 0.94552 0.9724
## Number of obs: 7695, groups: sub_id, 405
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.39128 0.03619 10.812
## bfi_self_pmc 0.19120 0.02506 7.630
## target_conditionLOSS -0.84609 0.05291 -15.991
## target_conditionWARM -0.39259 0.05155 -7.616
## bfi_self_pmc:target_conditionLOSS -0.37108 0.03655 -10.152
## bfi_self_pmc:target_conditionWARM -0.21686 0.03560 -6.092
##
## Correlation of Fixed Effects:
## (Intr) bf_sl_ t_LOSS t_WARM b__:_L
## bfi_slf_pmc 0.432
## trgt_cnLOSS -0.684 -0.296
## trgt_cnWARM -0.702 -0.304 0.480
## bf_s_:_LOSS -0.296 -0.685 0.433 0.208
## bf_s_:_WARM -0.304 -0.704 0.208 0.441 0.482
tab_model(bfi_nostereo_targ_pro)
| bfi_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.39 | 0.32 – 0.46 | <0.001 |
| bfi self pmc | 0.19 | 0.14 – 0.24 | <0.001 |
| target condition [LOSS] | -0.85 | -0.95 – -0.74 | <0.001 |
| target condition [WARM] | -0.39 | -0.49 – -0.29 | <0.001 |
|
bfi self pmc * target condition [LOSS] |
-0.37 | -0.44 – -0.30 | <0.001 |
|
bfi self pmc * target condition [WARM] |
-0.22 | -0.29 – -0.15 | <0.001 |
| Random Effects | |||
| σ2 | 0.95 | ||
| τ00 sub_id | 0.13 | ||
| τ11 sub_id.bfi_self_pmc | 0.06 | ||
| ρ01 sub_id | 0.65 | ||
| ICC | 0.20 | ||
| N sub_id | 405 | ||
| Observations | 7695 | ||
| Marginal R2 / Conditional R2 | 0.120 / 0.295 | ||
Did not change
bfi_nostereo_targ_pro <- emtrends(bfi_nostereo_targ_pro, ~ target_condition,
var ="bfi_self_pmc",
at = targ_levels)
bfi_nostereo_targ_pro
## target_condition bfi_self_pmc.trend SE df asymp.LCL asymp.UCL
## CONTROL 0.1912 0.0251 Inf 0.1421 0.2403
## LOSS -0.1799 0.0266 Inf -0.2320 -0.1277
## WARM -0.0257 0.0253 Inf -0.0752 0.0239
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
Did not change
bfi_stereo_comp_pro <- lmer(bfi_targ_pmc ~ bfi_self_pmc*itt_comp_gmc*bfi_stereo_pmc +
(bfi_self_pmc + bfi_stereo_pmc | sub_id), data = data_bfi_prolific)
summary(bfi_stereo_comp_pro)
## Linear mixed model fit by REML ['lmerMod']
## Formula: bfi_targ_pmc ~ bfi_self_pmc * itt_comp_gmc * bfi_stereo_pmc +
## (bfi_self_pmc + bfi_stereo_pmc | sub_id)
## Data: data_bfi_prolific
##
## REML criterion at convergence: 20454.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.2655 -0.5014 -0.0403 0.6150 4.2109
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## sub_id (Intercept) 0.12934 0.3596
## bfi_self_pmc 0.03863 0.1965 0.47
## bfi_stereo_pmc 0.06842 0.2616 -0.69 -0.08
## Residual 0.70147 0.8375
## Number of obs: 7695, groups: sub_id, 405
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.011888 0.020777 0.572
## bfi_self_pmc 0.070038 0.012904 5.428
## itt_comp_gmc -0.251778 0.019494 -12.916
## bfi_stereo_pmc 0.228417 0.016169 14.127
## bfi_self_pmc:itt_comp_gmc -0.076118 0.012059 -6.312
## bfi_self_pmc:bfi_stereo_pmc -0.021265 0.006406 -3.320
## itt_comp_gmc:bfi_stereo_pmc 0.189356 0.015116 12.527
## bfi_self_pmc:itt_comp_gmc:bfi_stereo_pmc -0.002961 0.005821 -0.509
##
## Correlation of Fixed Effects:
## (Intr) bf_sl_ itt_c_ bf_st_ bf_slf_pmc:t__ bf_slf_pmc:b__ i__:__
## bfi_slf_pmc 0.300
## itt_cmp_gmc -0.016 0.006
## bfi_str_pmc -0.481 0.049 0.033
## bf_slf_pmc:t__ 0.006 -0.042 0.292 -0.006
## bf_slf_pmc:b__ 0.142 -0.084 -0.013 0.073 0.050
## itt_cmp_:__ 0.033 -0.007 -0.480 -0.077 0.052 -0.001
## bf_s_:__:__ -0.013 0.050 0.148 -0.004 -0.080 -0.196 0.057
tab_model(bfi_stereo_comp_pro)
| bfi_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.01 | -0.03 – 0.05 | 0.567 |
| bfi self pmc | 0.07 | 0.04 – 0.10 | <0.001 |
| itt comp gmc | -0.25 | -0.29 – -0.21 | <0.001 |
| bfi stereo pmc | 0.23 | 0.20 – 0.26 | <0.001 |
|
bfi self pmc * itt comp gmc |
-0.08 | -0.10 – -0.05 | <0.001 |
|
bfi self pmc * bfi stereo pmc |
-0.02 | -0.03 – -0.01 | 0.001 |
|
itt comp gmc * bfi stereo pmc |
0.19 | 0.16 – 0.22 | <0.001 |
|
(bfi self pmc * itt comp gmc) * bfi stereo pmc |
-0.00 | -0.01 – 0.01 | 0.611 |
| Random Effects | |||
| σ2 | 0.70 | ||
| τ00 sub_id | 0.13 | ||
| τ11 sub_id.bfi_self_pmc | 0.04 | ||
| τ11 sub_id.bfi_stereo_pmc | 0.07 | ||
| ρ01 | 0.47 | ||
| -0.69 | |||
| ICC | 0.31 | ||
| N sub_id | 405 | ||
| Observations | 7695 | ||
| Marginal R2 / Conditional R2 | 0.221 / 0.463 | ||
Did not change
bfi_stereo_comp_pro <- emtrends(bfi_stereo_comp_pro, ~ itt_comp_gmc,
var ="bfi_self_pmc",
at = threat_levels)
bfi_stereo_comp_pro
## itt_comp_gmc bfi_self_pmc.trend SE df asymp.LCL asymp.UCL
## -1.07 0.1520 0.0187 Inf 0.1154 0.1886
## 0.00 0.0707 0.0129 Inf 0.0454 0.0960
## 1.07 -0.0107 0.0179 Inf -0.0457 0.0244
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
Did not change
bfi_stereo_targ_pro <- lmer(bfi_targ_pmc ~ bfi_self_pmc*target_condition*bfi_stereo_pmc +
(bfi_self_pmc | sub_id), data = data_bfi_prolific)
summary(bfi_stereo_targ_pro)
## Linear mixed model fit by REML ['lmerMod']
## Formula: bfi_targ_pmc ~ bfi_self_pmc * target_condition * bfi_stereo_pmc +
## (bfi_self_pmc | sub_id)
## Data: data_bfi_prolific
##
## REML criterion at convergence: 20807.7
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.1209 -0.5710 -0.0097 0.6350 3.8947
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## sub_id (Intercept) 0.11227 0.3351
## bfi_self_pmc 0.04738 0.2177 0.62
## Residual 0.77415 0.8799
## Number of obs: 7695, groups: sub_id, 405
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.379373 0.033444 11.344
## bfi_self_pmc 0.182813 0.023315 7.841
## target_conditionLOSS -0.838190 0.048786 -17.181
## target_conditionWARM -0.369054 0.047670 -7.742
## bfi_stereo_pmc -0.053031 0.015510 -3.419
## bfi_self_pmc:target_conditionLOSS -0.222962 0.033926 -6.572
## bfi_self_pmc:target_conditionWARM -0.121928 0.033104 -3.683
## bfi_self_pmc:bfi_stereo_pmc -0.027506 0.011273 -2.440
## target_conditionLOSS:bfi_stereo_pmc 0.602651 0.022011 27.380
## target_conditionWARM:bfi_stereo_pmc 0.344824 0.021803 15.816
## bfi_self_pmc:target_conditionLOSS:bfi_stereo_pmc -0.007515 0.015943 -0.471
## bfi_self_pmc:target_conditionWARM:bfi_stereo_pmc 0.013262 0.015496 0.856
##
## Correlation of Fixed Effects:
## (Intr) bf_sl_ tr_LOSS tr_WARM bf_st_ bf__:_LOSS bf__:_WARM b__:__
## bfi_slf_pmc 0.395
## trgt_cnLOSS -0.686 -0.271
## trgt_cnWARM -0.702 -0.277 0.481
## bfi_str_pmc 0.011 0.167 -0.008 -0.008
## bf_s_:_LOSS -0.271 -0.687 0.400 0.190 -0.115
## bf_s_:_WARM -0.278 -0.704 0.191 0.409 -0.118 0.484
## bf_slf_p:__ 0.154 -0.076 -0.106 -0.108 0.131 0.052 0.053
## trg_LOSS:__ -0.008 -0.118 0.016 0.006 -0.705 0.156 0.083 -0.092
## trg_WARM:__ -0.008 -0.119 0.006 0.035 -0.711 0.082 0.171 -0.093
## b__:_LOSS:_ -0.109 0.053 0.139 0.076 -0.093 -0.073 -0.038 -0.707
## b__:_WARM:_ -0.112 0.055 0.077 0.157 -0.095 -0.038 -0.055 -0.727
## t_LOSS: t_WARM: b__:_LOSS:
## bfi_slf_pmc
## trgt_cnLOSS
## trgt_cnWARM
## bfi_str_pmc
## bf_s_:_LOSS
## bf_s_:_WARM
## bf_slf_p:__
## trg_LOSS:__
## trg_WARM:__ 0.501
## b__:_LOSS:_ 0.115 0.066
## b__:_WARM:_ 0.067 0.158 0.514
tab_model(bfi_stereo_targ_pro)
| bfi_targ_pmc | |||
|---|---|---|---|
| Predictors | Estimates | CI | p |
| (Intercept) | 0.38 | 0.31 – 0.44 | <0.001 |
| bfi self pmc | 0.18 | 0.14 – 0.23 | <0.001 |
| target condition [LOSS] | -0.84 | -0.93 – -0.74 | <0.001 |
| target condition [WARM] | -0.37 | -0.46 – -0.28 | <0.001 |
| bfi stereo pmc | -0.05 | -0.08 – -0.02 | 0.001 |
|
bfi self pmc * target condition [LOSS] |
-0.22 | -0.29 – -0.16 | <0.001 |
|
bfi self pmc * target condition [WARM] |
-0.12 | -0.19 – -0.06 | <0.001 |
|
bfi self pmc * bfi stereo pmc |
-0.03 | -0.05 – -0.01 | 0.015 |
|
target condition [LOSS] * bfi stereo pmc |
0.60 | 0.56 – 0.65 | <0.001 |
|
target condition [WARM] * bfi stereo pmc |
0.34 | 0.30 – 0.39 | <0.001 |
|
(bfi self pmc * target condition [LOSS]) * bfi stereo pmc |
-0.01 | -0.04 – 0.02 | 0.637 |
|
(bfi self pmc * target condition [WARM]) * bfi stereo pmc |
0.01 | -0.02 – 0.04 | 0.392 |
| Random Effects | |||
| σ2 | 0.77 | ||
| τ00 sub_id | 0.11 | ||
| τ11 sub_id.bfi_self_pmc | 0.05 | ||
| ρ01 sub_id | 0.62 | ||
| ICC | 0.20 | ||
| N sub_id | 405 | ||
| Observations | 7695 | ||
| Marginal R2 / Conditional R2 | 0.268 / 0.416 | ||
Model fails to converge with random effect for stereo; Dropping random effect for stereo, but results appear the same
bfi_stereo_targ_pro <- emtrends(bfi_stereo_targ_pro, ~ target_condition,
var ="bfi_self_pmc",
at = targ_levels)
bfi_stereo_targ_pro
## target_condition bfi_self_pmc.trend SE df asymp.LCL asymp.UCL
## CONTROL 0.1836 0.0233 Inf 0.1379 0.22940
## LOSS -0.0391 0.0247 Inf -0.0874 0.00927
## WARM 0.0613 0.0235 Inf 0.0152 0.10741
##
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
Did not change
cor_bfi <- clean_data_bfi %>%
select(bfi_self_pmc, bfi_stereo_pmc, bfi_targ_pmc, itt_comp_gmc) %>%
unique() %>%
rename("BFI: Self" = bfi_self_pmc,
"BFI: Stereo" = bfi_stereo_pmc,
"BFI: Target" = bfi_targ_pmc,
"Threat Composite" = itt_comp_gmc)
correlations_preds <- cor(cor_bfi)
corrplot(correlations_preds,
is.corr = TRUE,
#method = "number",
method = 'color',
tl.cex = .85,
tl.col = 'black',
addgrid.col = 'white',
addCoef.col = 'grey50')